package net.begincode.biz.impl;

import net.begincode.auth.AuthChecker;
import net.begincode.auth.UserInfo;
import net.begincode.blog.UserContext;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
@Component
public class AuthCheckerImpl implements AuthChecker{
    @Override
    public String postLogin(UserInfo userInfo) {
        return null;
    }

    @Override
    public boolean postLogout(String s) {
        return false;
    }

    @Override
    public boolean isLogin(HttpServletRequest httpServletRequest) {
        //可以执行任何逻辑  默认不校验
        UserInfo userInfo = new UserInfo();
        userInfo.setId("1");
        userInfo.setToken("");
        UserContext.setUserInfo(userInfo);
        return true;
    }
}
